<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="node_modules/axios/dist/axios.js"></script>
    <script src="node_modules/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <button @click="send">发送Ajax请求</button>
    </div>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {

            },
            methods: {
                send: function () {
                    axios({
                        method: 'get',
                        url: 'user.json',
                        responseType: 'json'
                    }).then(function (resp) {
                        console.log(resp);
                        console.log(resp.data)
                    }).catch(err => {
                        console.log('请求失败')
                    })
                }
            }
        })
    </script>
</body>

</html>